<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="../css/conment.css">
    <!-- 引入头部和底部 -->
    <link rel="stylesheet" href="../css/public.css">
    <link rel="stylesheet" href="../fonts/css/font-awesome.css">
    <link rel="stylesheet" href="../css/sitenav.css">
</head>

<body>
    <!-- 头部 -->
    <header>
        <div class="header-one" id="header-Mall">
            <span class="Mall-left"><a href="../index.html"><i class="fa fa-chevron-left" aria-hidden="true"></i></a></span>
            <span class="clearfix Mall-conter"><a href="javascript:;">商品导航</a></span>
            <span class="clearfix Mall-right"><a href="javascript:;"><img src="../images/header_app.png" alt=""></i></a></span>
        </div>
    </header>
    <!-- 用于撑开头部 -->
    <div class="tmp"></div>
    <!-- 生体部分 -->
    <div class="view">
        <div class="view-conter clearfix">

        </div>
    </div>
</body>
<script src="../lib/jquery/jquery.js"></script>
<script src="../lib/template/template.js"></script>
<script src="../js/base.js"></script>

</html>
<!-- 渲染页面的模板 -->
<script type="text/template" id="small-title">
    {{each result as val key}}
    <!-- <a href="javascript:;"><i>{{val.navImg}}</i><span>{{val.navTitle}}</span></a> -->
    <a href="{{val.navHref}}"><img src="{{val.navImg}}" alt=""><span>{{val.navTitle}}</span></a>
    {{/each}}
</script>
<!-- 渲染页面 -->
<script>
    $.ajax({
        type: "get",
        url: 'http://193.112.55.79:9090/api/getsitenav',
        dataType: 'json',
        success: function (res) {
            console.log(res);
            template.config("escape", false);
            var htmlStr = template("small-title", res);
            $(".view-conter").html(htmlStr);
        }
    })
</script>